<!--
- @founder   IT柏拉图, https: //weibo.com/itprato
- @author    DedeCMS团队
- @copyright Copyright (c) 2007 - 2021, 上海卓卓网络科技有限公司 (DesDev, Inc.)
--->

<html>
<head>
<meta charset="{dede:global.cfg_soft_lang/}" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>DedeCMS系统配置参数管理器</title>
<meta name="copyright" content="2007-2021 DedeCMS, 上海卓卓网络科技有限公司 (DesDev, Inc.)" />
<link rel="icon" href="/favicon.ico" />
<!-- CSS FILES -->
<link rel="stylesheet" type="text/css" href="{dede:global.cfg_assets_dir/}/pkg/uikit/css/uikit.min.css" />
<link rel="stylesheet" type="text/css" href="{dede:global.cfg_assets_dir/}/css/manage.dede.css">
<style type="text/css">
.uk-table td{
padding: 6px 12px;
vertical-align: top;
height: 35px;
}
</style>
</head>
<body>
<!-- 列表头部 -->
<div id="Table_Header_202X2W2X1X292F" class="uk-card uk-card-small uk-card-default" uk-sticky="bottom: #offset">
<div id="Header_1W2T2S2T1V252B" class="uk-card-header">
<div class="uk-grid uk-grid-small uk-text-small">
<span><ul class="uk-breadcrumb"><li><span>DedeCMS系统配置参数管理器</span></li></ul></span>
</div>
<?php $ds = file(DEDEADMIN.'/inc/configgroup.txt');?>
<!-- 搜索表单 -->
<ul class="uk-navbar-nav dede-card-navbar" uk-navbar >
<li style="margin-right: 6px;">
<button class="uk-button uk-button-default uk-button-small uk-flex-inline ">添加新变量</button>
<div class="uk-navbar-dropdown " uk-dropdown="offset: 12;mode: click" style="width: 350px;">
<ul class="uk-nav uk-navbar-dropdown-nav" >
<li>
<form name="fadd" action="sys_info.php" method="post">
<input type='hidden' name='dopost' value='add'>
<input type="hidden" name="token" value="<?php echo $_SESSION['token']; ?>">
<fieldset id="dede-dropdown-margin" class="uk-fieldset"> <div class="uk-margin"><input class="uk-input uk-form-small uk-flex-inline uk-width-1-1" type="text" placeholder="变量名称" name="nvarname"/></div>
<div class="uk-margin"><input class="uk-input uk-form-small uk-flex-inline uk-width-1-1" type="text" placeholder="变量值" name="nvarvalue"/></div> <div class="uk-margin"><input class="uk-input uk-form-small uk-flex-inline uk-width-1-1" type="text" placeholder="参数说明" name="varmsg"/></div>
<div class="uk-margin">
<?php
echo "<select name='vargroup' class='uk-select uk-form-small'>\r\n";
foreach($ds as $dl){
$dl = trim($dl);
if(empty($dl)) continue;
$dls = explode(',',$dl);
echo "<option value='{$dls[0]}'>{$dls[1]}</option>\r\n";
}
echo "</select>\r\n";
?>
</div>
<div class="uk-margin">
<input name="vartype" type="radio" value="string" class='uk-radio' checked='checked' /> 文本 &nbsp;&nbsp;
<input name="vartype" type="radio" value="number" class='uk-radio' /> 数字 &nbsp;&nbsp;
<input type="radio" name="vartype" value="bool" class='uk-radio' /> 布尔(Y/N) &nbsp;&nbsp;
<input type="radio" name="vartype" value="bstring" class='uk-radio' /> 多行文本
</div>
<button type='submit' class="uk-button-primary uk-form-small uk-width-1-1" >添加</button>
</fieldset>
</form>
</li>
</ul>
</div>
</li>
</ul>
<!-- /搜索表单 -->
</div>
</div>
<!-- /列表头部 -->
<form action="sys_info.php" method="post" name="form1">
<input type="hidden" name="token" value="<?php echo $_SESSION['token']; ?>">
<input type="hidden" name="dopost" value="save">
<!-- 列表主体 -->
<div class="uk-card uk-card-small uk-card-default" style="top:-20px;margin-bottom: 50px;">
<div class="uk-card-body uk-overflow-auto" grid>
<div class="uk-child-width-1-1 uk-padding">
<ul uk-tab>
<?php
$totalGroup = count($ds);
$i = 0;
foreach($ds as $dl)
{
$dl = trim($dl);
if(empty($dl)) continue;
$dls = explode(',',$dl);
$i++;
if($i>1) echo "<li ><a>{$dls[1]}</a></li> ";
else{
echo " <li class='uk-active'><a>{$dls[1]}</a> ";
}
}
?>
</ul>
<ul class="uk-switcher">
<?php
$n = 0;
if(!isset($gp)) $gp = 1;
foreach($ds as $dl)
{
$dl = trim($dl);
if(empty($dl)) continue;
$dls = explode(',',$dl);
$n++;
?>
<li <?php if ($n == 1){ echo "class='uk-active'";}?> >
<table class="uk-table">
<tr>
<td width="20%">参数说明</td>
<td>参数值</td>
<td width="20%">变量名</td>
</tr>
<?php
$dsql->SetQuery("Select * From `#@__sysconfig` where groupid='{$dls[0]}' order by aid asc");
$dsql->Execute();
$i = 1;
while($row = $dsql->GetArray())
{
$i++;
?>
<tr>
<td>
<?php echo $row['info']; ?>：
</td>
<td>
<?php
if($row['type']=='bool')
{
$c1='';
$c2 = '';
$row['value']=='Y' ? $c1=" checked" : $c2=" checked";
echo "<input type='radio' class='uk-radio' name='edit___{$row['varname']}' value='Y'$c1> 是 &nbsp;&nbsp;";
echo "<input type='radio' class='uk-radio' name='edit___{$row['varname']}' value='N'$c2> 否 ";
}else if($row['type']=='bstring')
{
echo "<textarea name='edit___{$row['varname']}' row='4' id='edit___{$row['varname']}' class='uk-textarea uk-form-small' style='height:80px'>".dede_htmlspecialchars($row['value'])."</textarea>";
}else if($row['type']=='number')
{
echo "<input type='text' name='edit___{$row['varname']}' id='edit___{$row['varname']}' value='{$row['value']}' class='uk-input uk-form-small'>";
}else
{
$addstr='';
if ($row['varname']=='cfg_cookie_encode') {
$addstr=' <a href="javascript:resetCookieEncode();" style="color:blue">[重新生成]</a>';
}
echo "<input type='text' name='edit___{$row['varname']}' id='edit___{$row['varname']}' value=\"".dede_htmlspecialchars($row['value'])."\" class='uk-input uk-form-small'>{$addstr}";
}
?>
</td>
<td>
<?php echo $row['varname']?>
</td>
</tr>
<?php
}
?>
</table>
</li>
<?php
}
?>
</ul>
</div>
</div>
<div class="uk-card-footer " >
<div class="uk-padding-small" >
<button type="submit" class="uk-button uk-button-small uk-button-primary">提交</button>
</div>
</div>
</div>
</form>
<!-- 列表底部 -->
<div class="bar-bottom uk-flex uk-light uk-flex-right">
<div class="uk-button-group" style="margin-left: 50px;">
</div>
<div class="e1e02">Copyright &copy; 2007-2021 <a href='http://www.dedecms.com' target='_blank'><u>DedeCMS</u></a>, 上海卓卓网络科技有限公司 (DesDev, Inc.)</div>
</div>
<!-- 列表底部 -->
<!-- JS FILES -->
<script src="{dede:global.cfg_assets_dir/}/pkg/uikit/js/uikit.min.js"></script>
<script src="{dede:global.cfg_assets_dir/}/pkg/uikit/js/uikit-icons.min.js"></script>
<script src="{dede:global.cfg_assets_dir/}/pkg/jquery/jquery.min.js"></script>
<script src="{dede:global.cfg_assets_dir/}/js/dede.manage.min.js"></script>
<script language="javascript">
var searchconfig = false;
function $Obj(objname) {
return document.getElementById(objname);
}
function backSearch() {
location.reload();
}
function getSearch() {
var searchKeywords = $Obj('keywds').value;
var myajax = new DedeAjax($Obj('_search'));
myajax.SendGet('sys_info.php?dopost=search&keywords=' + searchKeywords)
$Obj('_searchback').innerHTML = '<input name="searchbackBtn" type="button" value="返回" id="searchbackBtn" onclick="backSearch()"/>'
$Obj('_mainsearch').innerHTML = '';
searchconfig = true;
}
function resetCookieEncode() {
jQuery.get("sys_info.php?dopost=make_encode", function (data) {
jQuery("#edit___cfg_cookie_encode").val(data);
});
}
</script>
<!-- / JS FILES -->
</body>
</html>
